import service from '@/utils/request'

// 去找接口文档？ 真实工作里面，后端一般是java，他们给的文档网站一般是  swagger.html

// 获取-部门列表 /company/department
export function companyDepartmentRequest() {
  return service({
    method: 'GET',
    url: '/company/department'
  })
}

// add get set delete clear update detail 几个常见的动词

// 获取-部门负责人列表 /sys/user/simple
export function getUserSimpleRequest() {
  return service({
    method: 'GET',
    url: '/sys/user/simple'
  })
}

// 新增-部门  /company/department
export function addDepartmentRequest(data) {
  // return service({
  //   method: 'POST',
  //   url: '/company/department',
  //   data: data
  // })
  return service.post('/company/department', data)
}

// 删除-部门详情  /company/department/{id}
export function deleteDepartmentRequest(id) {
  return service({
    method: 'DELETE',
    url: `/company/department/${id}`
  })
}

// 修改-部门详情  /company/department/{id}
export function updateDepartmentRequest(data) {
  return service({
    method: 'PUT',
    url: `/company/department/${data.id}`,
    data
  })
}

// 获取-部门详情  /company/department/{id}
export function getDepartmentDetailRequest(id) {
  return service({
    method: 'GET',
    url: `/company/department/${id}`
  })
}
